package com.rgs.rabbitmq.consumer;

import com.rgs.rabbitmq.config.RabbitMQConfig;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import java.util.Map;

/**
 * @program: com-rgs-parent
 * @description: 监听队列
 * @author: Mr.Ren
 * @create: 2023-01-06 10:52
 **/
@Component
@RabbitListener(queues = {RabbitMQConfig.RABBITMQ_DEMO_QUEUE})
public class DirectRabbitConsumer {


    @RabbitHandler
    public void process(Map map){
        System.out.println("消费者DirectRabbitConsumer成功消费到消息："+map.toString());
    }
}
